<template>
<div>数量{{num}}</div>
<button @click="numFn">点击</button>
</template>
<script lang="ts" setup>
const props = defineProps<{
    num:number
}>()
const emit = defineEmits<{
  (e:"update:num",value:number):void
}>()
const numFn = ()=>{
  emit("update:num",props.num-1)
}
</script>